import { ListModel, PageModel } from './common';

class CommentModel {
  public id: string;
  public clientId: string;
  public owner: string;
  public replies: CommentReplyModel[];
  public targetUrn: string;
  public targetVersion: string;
  public targetItemPath: string;
  public state: string;
  public attachments: AttachmentModel[];
  public content: CommentContentModel;
  public mentions: MentionsModel[];
  public context: string;
  public tag: string;
  public createAt: number;
  public updateAt: number;
  public targetItemWhereIs: string;
}

class CommentReplyModel {
  public id: string;
  public clientId: string;
  public replier: string;
  public content: CommentContentModel;
  public mentions: MentionsModel[];
  public attachments: AttachmentModel[];
  public context: string;
  public createAt: number;
  public state: number;
  public targetVersion: string;
  public tag: string;
}

class CommentContentModel {
  public content: string;
}

class AttachmentModel {
  public targetUrn: string;
  public targetName: string;
}

class MentionsModel {
  public userName: string;
  public realName: string;
}

class CommentListModel extends ListModel {
  public items: CommentModel[];
}

class CommentPageModel extends PageModel {
  public data: CommentListModel;
}

export {
  CommentModel,
  CommentReplyModel,
  AttachmentModel,
  MentionsModel,
  CommentPageModel
};
